import React,{useState,useEffect} from 'react';
import {sendActionGet} from '../../../../utils/axios'; 
import "./index.css";

const UserInfo=(props)=>{

    const [userInfo,setUserInfo]=useState("")

    useEffect(()=>{
        sendAction()
    },[])

    const sendAction=async()=>{
        const res = await sendActionGet("/api/v1/account/info");
        setUserInfo({
            ...res.data
        })
    }

    return(
        <div className="userinfocontainer">
        <p>账户内部id：<span>{userInfo.id}</span></p>
        <p>手机号：<span>{userInfo.phone}</span></p>
        <p>总容量(byte)：<span>{userInfo.totalSpace}</span></p>
        <p>已用容量(byte)：<span>{userInfo.usedSpace}</span></p>
        </div>
    )
}

export default UserInfo;